Update usage of git2-rs
authorAlex Crichton <alex@alexcrichton.com>
Wed, 31 Dec 2014 20:02:18 +0000 (12:02 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Wed, 31 Dec 2014 21:09:21 +0000 (13:09 -0800)
Cargo.lock
Cargo.toml
src/cargo/lib.rs
src/cargo/sources/git/utils.rs
src/rustversion.txt
src/snapshots.txt
tests/test_cargo_test.rs

index b2763ca0c2bd3a1d450dbb3cd4b59dc54934af30..6e294eb3c9f13bbc3b8f18f8de64ebacd147552f 100644 (file)
@@ -13,6 +13,7 @@ dependencies = [
  "rustc-serialize 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "semver 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "tar 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "term 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "time 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "toml 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
  "url 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -178,6 +179,14 @@ name = "tar"
 version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
+[[package]]
+name = "term"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+dependencies = [
+ "log 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
+]
+
 [[package]]
 name = "time"
 version = "0.1.5"
index 9d9fe8d0436fda90cf92617501399b0ea173dcf7..922b32b666a03b975b8938ec205f11f3daf17785 100644 (file)
@@ -5,6 +5,11 @@ authors = ["Yehuda Katz <wycats@gmail.com>",
            "Carl Lerche <me@carllerche.com>",
            "Alex Crichton <alex@alexcrichton.com>"]
 
+[profile.test]
+debug = false
+[profile.dev]
+debug = false
+
 [lib]
 name = "cargo"
 path = "src/cargo/lib.rs"
@@ -22,6 +27,7 @@ log = "0.1.0"
 docopt = "0.6.19"
 url = "0.2.7"
 rustc-serialize = "0.1.5"
+term = "0.1"
 
 [dev-dependencies.hamcrest]
 git = "https://github.com/carllerche/hamcrest-rust.git"
index a2baf0722e605d1b07cd13d783be3848d1723969..9a6768500c96e7470efdb90560367c71839be768 100644 (file)
@@ -1,8 +1,7 @@
 #![crate_name="cargo"]
 #![crate_type="rlib"]
 
-#![feature(macro_rules, phase)]
-#![feature(default_type_params)]
+#![feature(macro_rules, phase, default_type_params, unboxed_closures)]
 #![deny(unused)]
 #![cfg_attr(test, deny(warnings))]
 
index 2389b6d629bb309b003fb89a226ba79a81399f67..33a0e06ba67fb9f9b8e81996a87ddd8df45d5edf 100644 (file)
@@ -343,7 +343,7 @@ impl<'a> GitCheckout<'a> {
 
 fn with_authentication<T>(url: &str,
                           cfg: &git2::Config,
-                          f: |git2::Credentials| -> CargoResult<T>)
+                          f: |&mut git2::Credentials| -> CargoResult<T>)
                           -> CargoResult<T> {
     // Prepare the authentication callbacks.
     //
@@ -365,7 +365,7 @@ fn with_authentication<T>(url: &str,
     let mut cred_helper = git2::CredentialHelper::new(url);
     cred_helper.config(cfg);
     let mut cred_error = false;
-    let ret = f(|url, username, allowed| {
+    let ret = f(&mut |&mut: url, username, allowed| {
         let creds = if allowed.contains(git2::SSH_KEY) {
             let user = username.map(|s| s.to_string())
                                .or_else(|| cred_helper.username.clone())
@@ -395,9 +395,10 @@ pub fn fetch(repo: &git2::Repository, url: &str,
     // Create a local anonymous remote in the repository to fetch the url
 
     with_authentication(url, &try!(repo.config()), |f| {
-        let mut cb = git2::RemoteCallbacks::new()
-                                       .credentials(f);
-        let mut remote = try!(repo.remote_anonymous(url.as_slice(), refspec));
+        let mut cb = git2::RemoteCallbacks::new();
+        cb.credentials(|a, b, c| f.call_mut((a, b, c)));
+        let mut remote = try!(repo.remote_anonymous(url.as_slice(),
+                                                    Some(refspec)));
         try!(remote.add_fetch("refs/tags/*:refs/tags/*"));
         remote.set_callbacks(&mut cb);
         try!(remote.fetch(&["refs/tags/*:refs/tags/*", refspec], None, None));
index 42d1f76e6ce47f335589ed7afd16d4c711b27de3..8cbc9fc6e97408f35d17c225e34d0ce66371e7e5 100644 (file)
@@ -1 +1 @@
-2014-12-29
+2014-12-30
index f08e9d6ae731eccc1fd547b9c2d25c4e04c9a1bb..29ab022530d184f32737c99557cdd8c7778b8ae0 100644 (file)
@@ -1,3 +1,11 @@
+2014-12-30
+  linux-i386 ab8bba0918d3d2ddbd7fd21f147e223dbf04cece
+  linux-x86_64 0efe0f7bcbcbeb5494affcc8a2207db448a08c45
+  macos-i386 e5097005b0a27c186b8edee24982fd4c3ebba81e
+  macos-x86_64 6c0bb776e5645fb93b67341b111c715f39b25511
+  winnt-i386 2088c5256445b5bb2da57a71f6a9671e5a280477
+  winnt-x86_64 950e25bcedc5ba9d96891523c9967f81d5f6c74d
+
 2014-12-21
   linux-i386 4dea04e278192c5409f43794a98f20a8f59df2d9
   linux-x86_64 3e48c573d3c4d26591feb7bfe988174720f08374
index dcab4a4a5c1bd26d48744a8ad6f832b0e292e4b0..e41f04da6a63c5d11a4491e5e3ea999cbbd8b7bc 100644 (file)
@@ -268,9 +268,10 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
 {doctest} bar
 
-running 0 tests
+running 1 test
+test bar_0 ... ok
 
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
 ",
                        compiling = COMPILING, running = RUNNING,
@@ -567,9 +568,10 @@ test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
 {doctest} syntax
 
-running 0 tests
+running 1 test
+test foo_0 ... ok
 
-test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured
+test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured
 
 ",
                        compiling = COMPILING, running = RUNNING,